/*
 *  Cell.h
 *  GraphPaper
 *
 *  Created by Olivier Namet on 30/03/2010.
 *  Copyright 2010 Home. All rights reserved.
 *
 */

#ifndef CELL_H
#define CELL_H

#include <iostream>
#include <stdlib.h>


#include "Pos.h"

#include <vector>



//class Port;

#include "GraphElement.h"

#include "Port.h"

class Cell : public GraphElement
{
	
	
public:

	Cell(std::string s);
	Cell(float x, float y);
	Cell(std::string s, float x, float y);
	Cell(std::string s, Pos *p);
	
	~Cell();
	
	std::string getName() {return name;}
	void setName(std::string s) {name = s;}
	
	Pos *getPos() {return &pos;}
	float getX() {return pos.getX();}
	float getY() {return pos.getY();}
	
	void setPos(Pos *v) {pos.setX(v->getX());pos.setY(v->getY());}
	void setX(float xx) {pos.setX(xx);}
	void setY(float yy) {pos.setY(yy);}
	
	void addPort();
	void removePort(int i);
	std::vector<Port>ports;
	
	void updatePortPositions();
	

	
private:
	static int cellCount;
	
	std::string name;
	Pos pos;
	
	
	
	
	
};



#endif
